home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / disk / misc / TransADF.lha / Source / util.h < prev    next >
C/C++ Source or Header  |  1997-12-06  |  2KB  |  67 lines

  1. #ifndef TRANSADF_UTIL_H
  2. #define TRANSADF_UTIL_H
  3.  
  4.  
  5. /*------------------------------------*/
  6. /* Miscellaneous functions and macros */
  7. /*------------------------------------*/
  8.  
  9. #ifndef EXEC_TYPES_H
  10. #include <exec/types.h>
  11. #endif /* EXEC_TYPES_H */
  12.  
  13. #ifndef DOS_DOS_H
  14. #include <dos/dos.h>
  15. #endif /* DOS_DOS_H */
  16.  
  17. #ifndef CLIB_EXEC_PROTOS_H
  18. #include <clib/exec_protos.h>
  19. #endif /* CLIB_EXEC_PROTOS_H */
  20.  
  21. #ifndef CLIB_DOS_PROTOS_H
  22. #include <clib/dos_protos.h>
  23. #endif /* CLIB_DOS_PROTOS_H */
  24.  
  25.  
  26. /*---------------*/
  27. /* Useful Macros */
  28. /*---------------*/
  29.  
  30. /* Output the track and side of (ULONG) tr to (BPTR) f. */
  31. #define FPUTS_TS(tr,f) FPrintf ((f),"track %ld side %ld",((tr)>>1),((tr)&1))
  32.  
  33. /* Check to see if Control-C has been pressed */
  34. #define CTRL_C         (SetSignal(NULL,NULL) & SIGBREAKF_CTRL_C)
  35.  
  36.  
  37. /* File types as returned by getFileType() */
  38. #define FT_UNKNOWN    0    /* Default file type.                          */
  39. #define FT_DOS        1    /* AmigaDOS disk.                              */
  40. #define FT_ZLIB       2    /* ZLib stream (as defined in RFC-1950).       */
  41. #define FT_GZIP       3    /* GZip file (as defined in RFC-1952).         */
  42. #define FT_PKZIP      4    /* 'Standard' Zip as used by PK- and Info-Zip. */
  43. #define FT_PKZIP_ADD  5    /* Add a new file to a PKZip archive.          */
  44.  
  45.  
  46. /*---------------------*/
  47. /* Function prototypes */
  48. /*---------------------*/
  49.  
  50. LONG   Name2Unit (STRPTR devName);
  51.  
  52. #ifndef COMPILE_LITE
  53. ULONG  getFileType (BPTR file);
  54. BOOL   writeHead (BPTR outFile, STRPTR origName, ULONG fileType);
  55. BOOL   finishFile (BPTR outFile, ULONG CRC, ULONG CSize, ULONG USize, 
  56.                    ULONG fileType);
  57. BOOL   skipHead (BPTR inFile, STRPTR origName, ULONG fileType);
  58. BOOL   readTail (BPTR inFile, ULONG *CRC, ULONG *USize, ULONG fileType);
  59. ULONG  unixDate (void);
  60. ULONG  dosDate (void);
  61. UWORD  LES (UWORD num);
  62. ULONG  LEL (ULONG num);
  63. #endif /* COMPILE_LITE */
  64.  
  65.  
  66. #endif /* TRANSADF_UTIL_H */
  67.